package com.gzu.ltms.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;


@Getter
@AllArgsConstructor
public enum UpdateEnum {

    // 密码
    PASSWORD(1),
    // 邮箱
    EMAIL(2);

    private final Integer value;

    public static UpdateEnum valueOf(Integer code) {
        for (UpdateEnum updateEnum : UpdateEnum.values()) {
            if (Objects.equals(code, updateEnum.getValue())) {
                return updateEnum;
            }
        }
        return null;
    }
}
